package com.xxxx.server.utils;


import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.xxxx.server.page.EmployeeExcel;
import com.xxxx.server.pojo.*;
import com.xxxx.server.service.IEmployeeService;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

public class ExcelImportData extends AnalysisEventListener<Employee> {
    //默认每5条插入数据库
    private static final int BATCH_SIZE = 5;

    private IEmployeeService employeeService;

    public ExcelImportData() {
    }

    public ExcelImportData(IEmployeeService employeeService) {
        this.employeeService = employeeService;
    }

    List<Employee> list = new ArrayList<Employee>();

    public static List<EmployeeExcel> importExcelEmployee(MultipartFile file, List<Nation> allNations,
                                                          List<PoliticsStatus> allPoliticsstatus,
                                                          List<Department> allDepartments,
                                                          List<Position> allPositions,
                                                          List<Joblevel> allJobLevels) {

        EmployeeExcel employee = null;
        List<EmployeeExcel> list = new ArrayList<>();
        return list;
    }

    @Override
    public void invoke(Employee employee, AnalysisContext analysisContext) {

    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
